package com.bw.lib_common.websocket;

import com.bw.lib_common.utils.LoggerUtils;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

/**
 * @Author : ZhouZiYao
 * @Time : On 2023/11/18 10:24
 * @Description :
 */
public class ZWebSocketClient extends WebSocketClient {
    public ZWebSocketClient(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {
        LoggerUtils.i("123", "onOpen()");
    }

    @Override
    public void onMessage(String message) {
        LoggerUtils.i("123", "onMessage()");
    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
        LoggerUtils.i("123", "onClose()");
    }

    @Override
    public void onError(Exception ex) {
        LoggerUtils.i("123", "onError()");
    }
}
